package com.sunshine.ssm.mq.amqp;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Author: WeiHong
 * @Date: 2017/3/30 15:24
 */
public class App {


    public static void main(String[] args) throws InterruptedException {

        AbstractApplicationContext ctx =
                new ClassPathXmlApplicationContext("spring/spring-amqp.xml");
        RabbitTemplate template = ctx.getBean(RabbitTemplate.class);
        template.convertAndSend("Hello, world!");
        Thread.sleep(1000);
        ctx.destroy();
    }

}
